<div class="filter {{#ifInList cur.modifier "null,notnull"}}filter-novalue{{/ifInList}}" data-prefix="filter_{{cur.name}}">
  <div class="input-group filter-key">
    <span class="input-group-btn">
      <button type="button" class="btn btn-primary" onclick="htmlapi.filterRemove(this)"><i class="glyphicon glyphicon-minus-sign"></i></button>
    </span>
    <select class="form-control" id="filter_{{cur.name}}_name" onchange="htmlapi.filterChange(this)">
    {{#eachProperty allFilterSchema}}
      <option value="{{key}}" {{#ifEqual key ../cur.name}} SELECTED{{/ifEqual}}>{{key}}</option>
    {{/eachProperty}}
    </select>
    <span class="input-group-btn">
      {{#if thisFilterSchema.modifiers}}
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
          <span class="filter-modifier-label">{{displayModifier cur.modifier}}</span>
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu text-right pull-right" style="min-width: 0">
          {{#each thisFilterSchema.modifiers}}
            <li>
              <a href="#" onclick="htmlapi.filterModifierChange(this); return false;" data-value="{{.}}" data-label="{{displayModifier .}}">
                {{displayModifier .}}
              </a>
            </li>
          {{/each}}
        </ul>
      {{else}}
        =
      {{/if}}
    </span>
    <input type="hidden" class="filter-modifier-input" id="filter_{{cur.name}}_modifier" value="{{cur.modifier}}"/>
  </div>


  {{#if options}}
    <select class="form-control filter-value" id="filter_{{cur.name}}_value">
      <option value=""></option>
      {{#eachProperty options}}
        <option value="{{value}}" {{#ifEqual ../cur.value value}} SELECTED{{/ifEqual}}>{{value}}</option>
      {{/eachProperty}}
    </select>
  {{else}}
    <input type="text" class="form-control input-sm filter-value" id="filter_{{cur.name}}_value" value="{{cur.value}}" />
  {{/if}}
</div>
